<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 100px;
            height: 100px;
        }
        .one{
            background-color: blue;
            /* 开启固定定位  fixed
            /* position: fixed; */
        }
        .fixed{
            background-color: darkgoldenrod;
            /* 开启固定定位  fixed
            特点：1.脱离文档流，原先位置不保留，飘在文档流上方
                2.相对于浏览器定位，
            */
            position: fixed;
            right: 50px;
            bottom: 50px;
        }
    </style>
</head>
<body>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <section>块级元素</section>
    <div class="one">
       
    </div>
    <div class="fixed">
        <a href="#">回到顶部</a>
    </div>
    <!-- 粘滞定位 position:sticky -->
</body>
</html>